import type { App } from "vue";

// http://ckang1229.gitee.io/vue-markdown-editor/zh/#%E4%BB%8B%E7%BB%8D

// @ts-ignore
import VueMarkdownEditor from "@kangc/v-md-editor";
import "@kangc/v-md-editor/lib/style/base-editor.css";

// @ts-ignore
// import githubTheme from "@kangc/v-md-editor/lib/theme/github.js";
// import "@kangc/v-md-editor/lib/theme/style/github.css";

import vuepressTheme from "@kangc/v-md-editor/lib/theme/vuepress.js";
import "@kangc/v-md-editor/lib/theme/style/vuepress.css";

// @ts-ignore
import createLineNumbertPlugin from "@kangc/v-md-editor/lib/plugins/line-number/index";

// @ts-ignore
import createEmojiPlugin from "@kangc/v-md-editor/lib/plugins/emoji/index";
import "@kangc/v-md-editor/lib/plugins/emoji/emoji.css";

// @ts-ignore
import createTodoListPlugin from "@kangc/v-md-editor/lib/plugins/todo-list/index";
import "@kangc/v-md-editor/lib/plugins/todo-list/todo-list.css";

// @ts-ignore
import createCopyCodePlugin from "@kangc/v-md-editor/lib/plugins/copy-code/index";
import "@kangc/v-md-editor/lib/plugins/copy-code/copy-code.css";

// import hljs from "highlight.js";

// @ts-ignore
import Prism from "prismjs";

export default {
  install: (app: App<Element>): void => {
    // VueMarkdownEditor.use(githubTheme, {
    // 	Hljs: hljs
    // });
    VueMarkdownEditor.use(vuepressTheme, {
      Prism
    });

    VueMarkdownEditor.use(createLineNumbertPlugin());
    VueMarkdownEditor.use(createEmojiPlugin());
    VueMarkdownEditor.use(createTodoListPlugin());
    VueMarkdownEditor.use(createCopyCodePlugin());

    app.use(VueMarkdownEditor);
  }
};
